<h2 class="search-title popSearchTitle">Contact Seller</h2>
<div class="ques-popup">
    <form action="" method="post" id="message">
    <input type="hidden" value="<?php echo $qData['Product']['id'];?>" name="data[Message][item]" />
    <input type="hidden" value="1" name="data[MessageTrack][msg_type]" />
<fieldset>
 <label>Item :</label>
<input type="hidden" value="<?php echo $qData['User']['id'];?>" name="data[MessageTrack][to_id]" />
 <p><?php echo $qData['Product']['products_title'];?></p>
 </fieldset>
 <fieldset>
 <input type="hidden" value="<?php echo $session->read('Auth.User.id');?>" name="data[MessageTrack][from_id]" />

</fieldset>
<fieldset>
 <label>Subject :</label>
 <input type="text" name="data[Message][subject]" />
   
</fieldset>

<fieldset style="padding:10px 0; border-top:1px solid; border-bottom:1px solid; margin:10px 0;">

<textarea name="data[Message][message]">Enter additional information here</textarea>

</fieldset>
<fieldset class="btn">
  <input type="button" value="Cancel" name="" class="popupClose" />
  <input type="submit" value="Send" name="sendMessege" />
</fieldset>
</form>
</div>
<script type="text/javascript">
    jQuery(document).ready(function(){
        var content='<p>Your question was successfully sent to <?php echo $qData['User']['first_name'];?></p><br /><input type="button" value="Close" onclick=disablePopup(); />';
	jQuery('input:submit[name="sendMessege"]').click(function(){
	var dataString=jQuery('#message').serialize();
	jQuery.ajax({
			type: "POST",
			url: baseurl+"/products/sendMessege",
			data: dataString,
			success: function(data) {
                            jQuery('.ques-popup').fadeOut();
                            jQuery('.ques-popup').remove();
                            jQuery(content).insertAfter('.popSearchTitle');
			}
		});
		return false;
	});
});

jQuery('.popupClose').click(function(){
    disablePopup();
})
</script>